import request from "@/lib/request";
import {API} from "@/api/typings";

/** addQuestionBankQuestion POST /questionBankQuestion/add */
export async function addQuestionBankQuestionUsingPost(
  body: API.QuestionBankQuestionRequest,
  options?: { [key: string]: any },
): Promise<API.BaseResponse<boolean>> {
  return request("/questionBankQuestion/add", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** addBatchQuestionBankQuestion POST /questionBankQuestion/batch */
export async function addBatchQuestionBankQuestionUsingPost(
    body: API.QuestionBankQuestionBatchRequest,
    options?: { [key: string]: any },
): Promise<API.BaseResponse<boolean>> {
  return request("/questionBankQuestion/batch", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** updateQuestionBankQuestion POST /questionBankQuestion/update */
export async function updateQuestionBankQuestionUsingPost(
    body: API.QuestionBankQuestionRequest,
    options?: { [key: string]: any },
): Promise<API.BaseResponse<boolean>> {
  return request("/questionBankQuestion/update", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** getQuestionBankByQuestionId GET /questionBankQuestion/getBankList */
export async function getQuestionBankByQuestionIdUsingGet(
    params: API.QuestionIdParam,
    options?: { [key: string]: any },
): Promise<API.BaseListResponse<API.QuestionBankQuestion>> {
  return request("/questionBankQuestion/getBankList", {
    method: "GET",
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** getQuestionBankByQuestionId GET /questionBankQuestion/removeQuestion */
export async function removeByBankIdUsingGet(
    params: API.QuestionBankIdParam,
    options?: { [key: string]: any },
): Promise<API.BaseResponse<boolean>> {
  return request("/questionBankQuestion/removeQuestion", {
    method: "GET",
    params: {
      ...params,
    },
    ...(options || {}),
  });
}